<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="ceph" uri="http://jsp.cephb.fr" %>
<c:set var="page_title" scope="request" value="About SNP"/>
<% out.clear(); %><jsp:include page="xhtml-header.jsp" />
<div>



<form action="${pageContext.request.contextPath}/operon"
	  method="post"
	  enctype="multipart/form-data"
	  >
<input type="hidden" name="act" value="about-snp"/>
<!-- DEBUG: step was (${step} / ${param.step}) -->

<!--  assembly -->
<c:if test="${step=='0' ||  step=='1' || step=='2'|| step=='3'}">
	<c:forEach var="as" items="${assemblies}">
		<input type="hidden" name="as" value="${as.id}"/>
	</c:forEach>
</c:if>

<!--  mPanel -->
<c:if test="${ step=='1' || step=='2'|| step=='3'}">
	<c:forEach var="mpanel" items="${mpanels}">
		<input type="hidden" name="mpanel" value="${mpanel.uid}"/>
	</c:forEach>
</c:if>
<!--  format -->
<c:if test="${ step=='2'|| step=='3'}">
	<c:forEach var="fmt" items="${fmts}">
		<input type="hidden" name="fmt" value="${fmt}"/>
	</c:forEach>
</c:if>
<!--  Genotypes -->
<c:if test="${step=='3'}">
	<c:forEach var="prjfin4dna" items="${prjfin4dnas}">
		<input type="hidden" name="prjfin4dna" value="${prjfin4dna.projCode}"/>
	</c:forEach>
</c:if>

<c:choose>
<c:when test="${empty step}">
	<input type="hidden" name="step" value="0"/>
	<fieldset>
	<legend>Choose An Assembly</legend>
		<p>Select an assembly. The position of your SNP will be given for the selected assemblies. Selecting a assembly also allow you to select a subset of genotypes (e.g. Mouse genotypes)</p>
		<ul>
			<c:forEach var="as" items="${assemblies}">
				<li>
					<input type="checkbox" value="${as.id}" name="as" id="ass${as.id}"/>
					<label for="ass${as.id}"><c:out escapeXml="true"  value="${as.name}"/></label>
				</li>
			</c:forEach>
		</ul>
	</fieldset>
</c:when>

<c:when test="${step =='0'}">
	<input type="hidden" name="step" value="1"/>
	
	<fieldset>
	<legend>Populations</legend>
		<p>Select a <a target="#" href="http://www.hapmap.org/citinghapmap.html">Hapmap Populations</a>.
		The frequencies of the genotypes will be added to the result file for each selected population.</p>
		<ul>
			<c:forEach var="mpanel" items="${mpanels}">
				<li><input type="checkbox"  name="mpanel" value="${mpanel.uid}"/> 
					<label>
						<u><c:out escapeXml="true" value="${mpanel.syn}"/></u>
						<c:out escapeXml="true" value="${mpanel.def}"/>
					</label>
				</li>
			</c:forEach>
		</ul>
	</fieldset>
</c:when>
	
<c:when test="${step =='1'}">
	<input type="hidden" name="step" value="2"/>
	
	
	
	<fieldset>
	<legend>Output</legend>
		<p>Select a Technology. The DNA context for each SNP will be added to the result.
		If a result is missing, Operon may considered that the design was invalid for this SNP (too much repeats, etc..).</p>
		<ul>
			<li><input type="checkbox"  name="fmt" value="taqman"/><label>Taqman</label></li>
			<li><input type="checkbox"  name="fmt" value="smplex"/><label>Snplex</label></li>
			<li><input type="checkbox"  name="fmt" value="sequenom"/><label>Sequenom</label></li>
			<li><input type="checkbox"  name="fmt" value="illumina"/><label>Illumina</label></li>
			<li><input type="checkbox"  name="fmt" value="fasta"/><label>Fasta</label></li>
		</ul>
	</fieldset>
</c:when>

<c:when test="${step =='2'}">
	<input type="hidden" name="step" value="3"/>
	<fieldset>
	<legend>Genotypes</legend>
		<c:choose>
		
		<c:when test="${not empty  prjfin4dnas}">
			<ul>
				<c:forEach var="prjfin4dna" items="${prjfin4dnas}">
					<li>
						<input type="checkbox"  name="prjfin4dna" value="${prjfin4dna.projCode}" id="id${prjfin4dna.projCode}"/>
						<label for="id${prjfin4dna.projCode}">
							<b><c:out escapeXml="true" value="${prjfin4dna.projCode}" /></b> : <c:out escapeXml="true" value="${prjfin4dna.def}"/>
						</label>
					</li>
				</c:forEach>
			</ul>
		</c:when>
		<c:otherwise>
			<i>No data available for the selected assemblies</i>
		</c:otherwise>
		</c:choose>
	</fieldset>
</c:when>


<c:when test="${step =='3'}">
	<input type="hidden" name="step" value="4"/>
	<fieldset>
	<legend>Your list of SNP</legend>
	
		<ul>
			
			<li>Select a project SNP. This list was created under <b>Project</b> -&gt; Add SNP List<br/>
			<label>Project</label> <select name="prjfin">
			<option value="" selected="true">--</option>
			<c:forEach var="prjfin" items="${prjfins}">
			<option value="${prjfin.projCode}"><c:out escapeXml="true" value="${prjfin.projCode}" /> :
			<c:out  value="${prjfin.def}"/> <c:out  escapeXml="true" value="${prjfin.assembly}"/></option>
			</c:forEach>
			</select>
			</li>
		
		
		
		
			<li>Select a <b>tab</b> delimited file containing a set of SNP.
The first column <b>MUST</b> contains the SNP.
The first line <b>MUST</b> contain the headers.
This file can be gzipped. e.g.: 
<pre>
#Snp
rs25
rs26
rs27
rs28
rs29</pre>
Lines starting with '#' will be ignored.<br/><label>The file of SNP</label>
			<input type="file" name="file"/></li>
			
			<li>Copy and Paste a list of SNP. One SNP per line. e.g.:
<pre>rs25
rs26
rs27
rs28
rs29</pre>
Lines starting with '#' or blank line will be ignored.<br/><label>Paste your list:</label>
			<textarea name="area"></textarea><br/></li>
			
						
		</ul>
	</fieldset>
</c:when>
<c:otherwise>

Opps something wrong happened

</c:otherwise>
</c:choose>
<input value="Continue" type="submit"/>
</form>
</div>
<jsp:include page="xhtml-footer.jsp"/>
